Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer - The runProducerConsumers method might terminate prematurely #1086

Merged
merged 3 commits into from
Dec 24, 2023

Conversation

yahavi
Copy link
Member

@yahavi yahavi commented Dec 22, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

Depends on jfrog/gofrog#42.
Tests: jfrog/jfrog-cli#2384.
At times, the chunk uploader might have no upload tasks, resulting in setting the finish notification before all file uploads are completed. This could cause the runProducerConsumers to exit prematurely without finishing the uploading jobs.

When tasks are present in the queue without a polling task manager, it may lead to an increase in curProcessedUploadChunks without a corresponding decrease. This situation can escalate, especially when there are enough future upload tasks, potentially causing a deadlock by increasing curProcessedUploadChunks to the maximum number of allowed worker threads.

To resolve this, we reset the finish notification to ensure no remaining upload tasks after the subsequent finish notification.

@yahavi yahavi added the bug Something isn't working label Dec 22, 2023
@yahavi yahavi requested a review from eyalbe4 December 22, 2023 16:47
@yahavi yahavi self-assigned this Dec 22, 2023
@yahavi yahavi changed the title Transfer - Resolve an issue of the chunk uploader completing prematurely Transfer - The runProducerConsumers method might terminate prematurely Dec 22, 2023
@yahavi yahavi marked this pull request as draft December 22, 2023 16:59
Copy link
Contributor

👍 Frogbot scanned this pull request and found that it did not add vulnerable dependencies.


@yahavi yahavi merged commit 92c93a2 into jfrog:dev Dec 24, 2023
7 of 8 checks passed
@yahavi yahavi deleted the fix-finish-notification branch December 24, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants